import 'package:get/get.dart';
import 'package:my_app/app/data/services/shared_preferences_service.dart';

class SharedPreferencesController extends GetxController {
  SharedPreferencesService sharedPreferencesService =
      Get.find<SharedPreferencesService>();
  var storeValue = "".obs;
  var fieldText = "";
  @override
  void onInit() {
    super.onInit();
    storeValue.value = sharedPreferencesService.getStrValue("Test") ?? "";
  }

  void changeStoreValue() => {
        sharedPreferencesService.setStrValue("Test", fieldText),
        storeValue.value = fieldText
      };
  void changeFieldValue(String? value) => fieldText = value ?? "";
}
